home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 90 / CD Actual 90.iso / Software3D / VirtualLight / VLight1.3win32.exe / VibSDK / vlBinDef.h < prev   
Encoding:
C/C++ Source or Header  |  2002-10-07  |  16.4 KB  |  674 lines

  1. /*
  2.  * The VirtuaLight Binary Format API (VIBsdk for Visual C++)
  3.  * Written by Stephane Marty
  4.  * Version 1.0.4 (October 2002)
  5.  */
  6.  
  7. #if !defined(_VIB_SDK)
  8. #define _VIB_SDK
  9.  
  10. #include <stdlib.h>
  11. #include <stdio.h>
  12. #include <io.h>
  13. #include <math.h>
  14. #if defined(__BORLANDC__)
  15. #include <string.h>
  16. #endif
  17.  
  18. /*
  19.  * Basic defs
  20.  */
  21. typedef float viFLT;
  22.  
  23. // note: to restrict the size of files written out
  24. //       to disk, "float" is used instead of "double"
  25. typedef float viDBL;
  26.  
  27. typedef int viINT;
  28.  
  29. typedef unsigned char viBYTE;
  30.  
  31. typedef viDBL viMATRIX[4][4];
  32.  
  33. typedef struct vec { viDBL x, y, z; } viVECTOR;
  34.  
  35. typedef struct vec4p { viDBL x, y, z, H; } viVECTOR4p;
  36.  
  37. typedef struct col { viFLT r, g, b; } viCOLOR;
  38.  
  39. typedef struct cola { viBYTE r, g, b, a; } viCOLORBYTE;
  40.  
  41. typedef struct uv { viFLT u, v; } viUV;
  42.  
  43. typedef struct shear { viDBL yx, zx, xy, zy, xz, yz; } viSHEAR;
  44.  
  45. typedef struct trans {
  46.     viVECTOR Scale;
  47.     viVECTOR Rotate;
  48.     viVECTOR Translate;
  49. } viTRANSFORM;
  50.  
  51. typedef struct _iobuf viFILE;
  52.  
  53. /*
  54.  * Camera
  55.  */
  56. typedef struct form {    // image format
  57.     viINT X;
  58.     viINT Y;
  59. } viSform;
  60.  
  61. typedef struct clip {    // clipping
  62.     viDBL Near;
  63.     viDBL Far;
  64. } viSclip;
  65.  
  66. typedef struct dof {    // depth of field
  67.     viDBL Aperture;
  68.     viDBL Distance;
  69.     viINT Samples;
  70. } viSdof;
  71.  
  72. typedef struct exp {    // film exposure
  73.     viDBL Gain;
  74.     viDBL Gamma;
  75. } viSexp;
  76.  
  77. typedef struct pfilt {    // pixel filter
  78.     viDBL xWidth;
  79.     viDBL yWidth;
  80.     viBYTE Function;
  81. } viSpfilt;
  82.  
  83. typedef struct cam {    // Main Camera structure
  84.     viVECTOR Location;
  85.     viVECTOR LookAt;
  86.     viVECTOR UpAxis;
  87.     viDBL    FieldOfView;
  88.     viSform  Format;
  89.     viDBL    FrameAspectRatio;
  90.     viSclip  Clipping;
  91.     viSdof   DepthOfField;
  92.     viSexp   Exposure;
  93.     viINT    Antialiasing;
  94.     viINT    SuperAntialiasing;
  95.     viINT    Undersampling;
  96.     viBYTE   LensModel;
  97.     viSpfilt PixelFilter;
  98.     viTRANSFORM Transform;
  99. } viCAMERA;
  100.  
  101. /*
  102.  * Global options
  103.  */
  104. typedef struct gc {        // gamma correction
  105.     viDBL D;
  106.     viDBL DG;
  107. } viSgc;
  108.  
  109. typedef struct irr {    // monte carlo irradiance
  110.     viINT  BounceLevel;
  111.     viDBL  MaxError;
  112.     viINT  Samples;
  113.     viBYTE Distribution;
  114.     viINT  PhotonsSamples;
  115.     viINT  PhotonsMax;
  116.     viDBL  BlendingArea;
  117.     viDBL  MaxDistance;
  118. } viSirr;
  119.  
  120. typedef struct pgr {    // photons gather range
  121.     viINT  Min;
  122.     viINT  Max;
  123. } viSpgr;
  124.  
  125. typedef struct pacc {    // photons accelerator
  126.     viDBL  Caustics;
  127.     viDBL  Media;
  128.     viDBL  Irradiance;
  129. } viSpac;
  130.  
  131. typedef struct opt {    // Main Options structure
  132.     viDBL  AdaptiveThreshold;
  133.     viINT  AdaptiveDepth;
  134.     viDBL  ShadowBias;
  135.     viINT  BitsPerPixel;
  136.     char   OutputTo[64];
  137.     viSgc  GammaCorrection;
  138.     viDBL  SunGlow;
  139.     viBYTE ParallelSunRays;
  140.     viSirr Irradiance;
  141.     char   LoadIrradianceCache[64];
  142.     char   SaveIrradianceCache[64];
  143.     char   LoadPhotonMap[64];
  144.     char   SavePhotonMap[64];
  145.     viSpgr PhotonsGatherRange;
  146.     viSpac PhotonsAccelerator;
  147.     viBYTE MaxRayLevel;
  148.     viBYTE MaxBlurLevel;
  149.     viINT  SoftShadowSamples;
  150.     viINT  MaxBlurSamples;
  151.     viDBL  HenyeyGreenstein;
  152.     viINT  Z_Size;
  153. } viOPTIONS;
  154.  
  155. /*
  156.  * Independant features
  157.  */
  158. typedef struct fog {    // distant fog
  159.     viDBL   distance;
  160.     viDBL   coeff;
  161.     viCOLOR color;
  162. } viSfog;
  163.  
  164. typedef struct gfog {    // ground fog
  165.     viDBL   distance;
  166.     viDBL   height;
  167.     viCOLOR color;
  168. } viSgfog;
  169.  
  170. typedef struct phot {    // photons
  171.     viINT count;
  172.     viDBL density;
  173.     viINT media;
  174.     viINT volume;
  175. } viSphot;
  176.  
  177. typedef struct med {    // media
  178.     viINT   sm;
  179.     viINT   sa;
  180.     viDBL   de;
  181.     viDBL   sc;
  182.     viDBL   filter;
  183.     viINT   aalias;
  184.     viCOLOR color;
  185. } viSmed;
  186.  
  187. typedef struct gen {    // Main General structure
  188.     viCOLOR Background;
  189.     char    BackgroundExpression[32];
  190.     viSfog  Fog;
  191.     viSgfog GroundFog;
  192.     viINT   ComputeIrradiance;
  193.     viSphot Photons;
  194.     viSmed  Media;
  195. } viGENERAL;
  196.  
  197. /*
  198.  * Lights
  199.  */
  200. typedef struct p_light {    // point light
  201.     viVECTOR Position;
  202.     viCOLOR     Intensity;
  203.     viBYTE   Decay;
  204.     viDBL    Range;
  205.     viDBL    Glow;
  206.     viBYTE   LightingAttributes;
  207.     viBYTE   MediaInteraction;
  208. } viPOINT_LIGHT;
  209.  
  210. typedef struct s_light {    // spotlight
  211.     viVECTOR Position;
  212.     viVECTOR PointAt;
  213.     viDBL    Radius;
  214.     viDBL    Falloff;
  215.     viDBL    Tightness;
  216.     viCOLOR     Intensity;
  217.     viBYTE   Decay;
  218.     viDBL    Range;
  219.     viDBL    Bulb;
  220.     viBYTE   LightingAttributes;
  221.     viBYTE   MediaInteraction;
  222. } viSPOT_LIGHT;
  223.  
  224. typedef struct d_light {    // directional light
  225.     viVECTOR Direction;
  226.     viCOLOR     Intensity;
  227.     viBYTE   LightingAttributes;
  228. } viDIRECTIONAL_LIGHT;
  229.  
  230. typedef struct bh {            // black hole
  231.     viVECTOR Location;
  232.     viDBL    Density;
  233.     viCOLOR     Intensity;
  234. } viBLACK_HOLE;
  235.  
  236. typedef struct bulb {        // spherical light bulb
  237.     viVECTOR Location;
  238.     viDBL    Radius;
  239. } viSbulb;
  240.  
  241. typedef struct sa_light {    // spherical area light
  242.     viSbulb     Bulb;
  243.     viCOLOR        Intensity;
  244.     viBYTE      Decay;
  245.     viDBL       Range;
  246.     viDBL       Glow;
  247.     viBYTE      LightingAttributes;
  248.     viBYTE      MediaInteraction;
  249.     viTRANSFORM Transform;
  250. } viSPH_AREA_LIGHT;
  251.  
  252. typedef struct plan {        // plane light
  253.     viINT Row;
  254.     viINT Col;
  255.     viDBL Jitter;
  256.     viINT Level;
  257. } viSplan;
  258.  
  259. typedef struct fa_light {    // flat polygonal area light
  260.     viSplan     Plane;
  261.     viCOLOR        Intensity;
  262.     viBYTE      Decay;
  263.     viDBL       Range;
  264.     viBYTE      LightingAttributes;
  265.     viTRANSFORM Transform;
  266. } viFLAT_AREA_LIGHT;
  267.  
  268. typedef struct skl {    // skylight
  269.     viBYTE  Enabled;
  270.     viINT   samples;
  271.     viCOLOR color;
  272.     char    ColorExpression[32];
  273.     viDBL   brightness;
  274. } viSskl;
  275.  
  276. typedef struct sul {    // sunlight
  277.     viBYTE  Enabled;
  278.     viINT   hours;
  279.     viINT   minutes;
  280.     viINT   samples;
  281.     viDBL   brightness;
  282.     viCOLOR color;
  283.     viVECTOR Rotate;
  284. } viSsul;
  285.  
  286. typedef struct skydome {    // Main Skydome structure
  287.     viSskl SkyLight;
  288.     viSsul SunLight;
  289. } viSKY_DOME;
  290.  
  291. typedef struct rb {        // render bound
  292.     viDBL umin;
  293.     viDBL vmin;
  294.     viDBL umax;
  295.     viDBL vmax;
  296. } viSrb;
  297.  
  298. typedef struct shpsub {    // shape subdivisions
  299.     viINT u;
  300.     viINT v;
  301.     viINT w;
  302. } viSshpsubd;
  303.  
  304. typedef struct shpmod {    // Main Shape Modifiers structure
  305.     viSrb        RenderBound;
  306.     viINT        ShadingAttributes;
  307.     viSshpsubd    ShapeSubdivisions;
  308.     char        DisplacementMapping[32];
  309. } viSHAPE_MODIFIERS;
  310.  
  311. /*
  312.  * Shapes
  313.  */
  314. typedef struct pch {    // smooth triangular patch
  315.     viVECTOR v1;
  316.     viVECTOR n1;
  317.     viVECTOR v2;
  318.     viVECTOR n2;
  319.     viVECTOR v3;
  320.     viVECTOR n3;
  321. } viPATCH;
  322.  
  323. typedef struct pchuv {    // smooth triangular patch with uv
  324.     viVECTOR v1;
  325.     viVECTOR n1;
  326.     viUV     uv1;
  327.     viVECTOR v2;
  328.     viVECTOR n2;
  329.     viUV     uv2;
  330.     viVECTOR v3;
  331.     viVECTOR n3;
  332.     viUV     uv3;
  333. } viPATCH_UV;
  334.  
  335. typedef struct sph {    // sphere
  336.     viVECTOR center;
  337.     viDBL    radius;
  338. } viSPHERE;
  339.  
  340. typedef struct con {    // cone
  341.     viVECTOR base;
  342.     viDBL    baserad;
  343.     viVECTOR apex;
  344.     viDBL    apexrad;
  345. } viCONE;
  346.  
  347. typedef struct cyl {    // cylinder
  348.     viVECTOR bottom;
  349.     viVECTOR top;
  350.     viDBL    radius;
  351. } viCYLINDER;
  352.  
  353. typedef struct dis {    // disk
  354.     viVECTOR center;
  355.     viVECTOR normal;
  356.     viDBL    radius;
  357. } viDISK;
  358.  
  359. typedef struct rin {    // ring
  360.     viVECTOR center;
  361.     viVECTOR normal;
  362.     viDBL    majrad;
  363.     viDBL    minrad;
  364. } viRING;
  365.  
  366. typedef struct tor {    // torus
  367.     viVECTOR center;
  368.     viVECTOR dir;
  369.     viDBL    majrad;
  370.     viDBL    minrad;
  371. } viTORUS;
  372.  
  373. typedef struct box {    // box
  374.     viVECTOR corner1;
  375.     viVECTOR corner2;
  376. } viBOX;
  377.  
  378. typedef struct sup {    // superquadric
  379.     viDBL    h;
  380.     viDBL    w;
  381. } viSUPERQ;
  382.  
  383. typedef struct pol {    // polygon
  384.     viBYTE   vertices;
  385.     viVECTOR vertex[32];
  386. } viPOLYGON;
  387.  
  388. typedef struct nbs {    // nurbs
  389.     viINT       nu;
  390.     viINT       uorder;
  391.     viDBL       *uknot;
  392.     viINT       nv;
  393.     viINT       vorder;
  394.     viDBL       *vknot;
  395.     viVECTOR4p **cpoints;
  396.     viINT      nuknots, nvknots;
  397. } viNURBS;
  398.  
  399. typedef struct bez {    // bezier patch
  400.     viBYTE   basis;
  401.     viINT     ustep;
  402.     viINT     vstep;
  403.     viVECTOR vertices[16];
  404. } viBEZIER;
  405.  
  406. typedef struct parab {    // parabola
  407.     viVECTOR base;
  408.     viVECTOR top;
  409.     viDBL    radius;
  410. } viPARABOLOID;
  411.  
  412. typedef struct fld {    // blobby's component
  413.     viBYTE    type;
  414.     viVECTOR sc_cb_pn;
  415.     viVECTOR top;
  416.     viDBL    dist;
  417.     viDBL    radius;
  418.     viDBL    strength;
  419. } viFIELD;
  420.  
  421. typedef struct blob {    // blobby
  422.     viBYTE  solver;
  423.     viINT    fields;
  424.     viDBL    threshold;
  425.     viFIELD    *components;
  426. } viBLOBBY;
  427.  
  428. /*
  429.  * Misc defs
  430.  */
  431. #define VLIGHT_BIG        (1.0e+6)
  432. #define VLIGHT_SMALL    (1.0e-3)
  433. #define VLIGHT_EPSILON    (1.0e-8)
  434.  
  435. #ifndef FALSE
  436. #define FALSE    0
  437. #endif
  438. #ifndef TRUE
  439. #define TRUE    1
  440. #endif
  441. #ifndef M_PI
  442. #define M_PI (3.1415926535897932384626)
  443. #endif
  444.  
  445. // Irradiance distribution methods
  446. #define DISTRIB_REGULAR        0x01
  447. #define DISTRIB_GRID        0x02
  448. #define DISTRIB_HAMMERSLEY    0x03
  449. #define DISTRIB_ADAPTIVE_U    0x04
  450. #define DISTRIB_RANDOM        0x05
  451. #define DISTRIB_NROOKS        0x06
  452.  
  453. // Light source decay rates
  454. #define DECAY_LINEAR        0x01
  455. #define DECAY_QUADRATIC        0x02
  456. #define DECAY_CUBIC            0x03
  457.  
  458. // Lighting attributes
  459. #define LIGHT_ATTRIB_NOTHING    0x00
  460. #define LIGHT_ATTRIB_SHADOW        0x01
  461. #define LIGHT_ATTRIB_SPECULAR    0x02
  462. #define LIGHT_ATTRIB_ONESIDED    0x04
  463. #define LIGHT_ATTRIB_AUTOORIENT    0x08
  464.  
  465. // Camera lenses
  466. #define LENS_PERSPECTIVE    0xf0
  467. #define LENS_ORTHOGRAPHIC    0xf1
  468. #define LENS_WIDE_ANGLE        0xf2
  469. #define LENS_FISHEYE        0xf3
  470. #define LENS_PANORAMIC        0xf4
  471. #define LENS_OMNIMAX        0xf5
  472.  
  473. // Participating media scattering models
  474. #define ISOTROPIC_SCATTERING    0x01
  475. #define RAYLEIGH_SCATTERING        0x02
  476. #define MIE_SCATTERING            0x03
  477. #define HENYEY_SCATTERING        0x04
  478.  
  479. // Blobby field types
  480. #define FIELD_SPHERE        0x01
  481. #define FIELD_CYLINDER        0x02
  482. #define FIELD_PLANE            0x03
  483.  
  484. // Bicubic patch basis
  485. #define BEZIER_MATRIX        0x01
  486. #define BSPLINE_MATRIX        0x02
  487. #define CATMULLROM_MATRIX    0x03
  488. #define HERMITE_MATRIX        0x04
  489.  
  490. // Root solvers for blobby
  491. #define FERRARI_SOLVER        0x01
  492. #define VIETA_SOLVER        0x02
  493. #define STURM_SOLVER        0x03
  494.  
  495. // Pixel filter types
  496. #define BOXfilter            0x01
  497. #define    TRIANGLEfilter        0x02
  498. #define    CATMULLROMfilter    0x03
  499. #define    GAUSSIANfilter        0x04
  500. #define    SINCfilter            0x05
  501. #define    DISKfilter            0x06
  502. #define    BESSELfilter        0x07
  503.  
  504. // Variable/data initialization macros
  505. #define viSetInt(a, b)            a = (viINT)(b)
  506. #define viSetDbl(a, b)            a = (viDBL)(b)
  507. #define viSetFlt(a, b)            a = (viFLT)(b)
  508. #define viSetByte(a, b)            a = (viBYTE)(b)
  509. #define viSetString(s1,s2)        {memset(s1,0,sizeof(s1));memcpy((s1),(s2),sizeof(s1));}
  510. #define viSetVector(v, x, y, z)    viMakeVector(v, (viDBL)(x), (viDBL)(y), (viDBL)(z))
  511. #define viSetControlPoint(v, x, y, z) viMakeVector4p(v, (viDBL)(x), (viDBL)(y), (viDBL)(z), 0)
  512. #define viSetControlPointR(v, x, y, z, h) viMakeVector4p(v, (viDBL)(x), (viDBL)(y), (viDBL)(z), (viDBL)(h))
  513. #define viSetColor(c, r, g, b)    viMakeColor(c, (viFLT)(r), (viFLT)(g), (viFLT)(b))
  514. #define viSetShear(s, yx, zx, xy, zy, xz, yz)    viMakeShear(s, (viDBL)(yx), (viDBL)(zx), (viDBL)(xy), (viDBL)(zy), (viDBL)(xz), (viDBL)(yz))
  515.  
  516. /*
  517.  * viVECTOR macro definitions
  518.  */
  519. #define viCopyVector(v1,v2)        memcpy((v1),(v2),sizeof(viVECTOR))
  520. #define viVecAdd(a, b, c)        {(a).x=(b).x+(c).x;(a).y=(b).y+(c).y;(a).z=(b).z+(c).z;}
  521. #define viVecSubstract(a, b, c)    {(a).x=(b).x-(c).x;(a).y=(b).y-(c).y;(a).z=(b).z-(c).z;}
  522. #define viVecDivide(a, b, c)    {(a).x=(b).x/(c).x;(a).y=(b).y/(c).y;(a).z=(b).z/(c).z;}
  523. #define viVecScale(a, b, k)        {(a).x=(b).x*(k);(a).y=(b).y*(k);(a).z=(b).z*(k);}
  524. #define viVecDot(a, b, c)        {a=(b).x*(c).x+(b).y*(c).y+(b).z*(c).z;}
  525. #define viVecCross(a,b,c)        {(a).x=(b).y*(c).z-(b).z*(c).y; \
  526.                                 (a).y=(b).z*(c).x-(b).x*(c).z; \
  527.                                 (a).z=(b).x*(c).y-(b).y*(c).x;}
  528. #define viVecLength(a, b)        {a=sqrt((b).x*(b).x+(b).y*(b).y+(b).z*(b).z);}
  529. #define viVecDistance(a, b, c)    {viVECTOR vtmp; viVecSubstract(vtmp, b, c); viVecLength(a, vtmp);}
  530. #define viVecNormalize(a)        {viDBL dtmp=(viDBL)(1.0/sqrt((a).x*(a).x+(a).y*(a).y+(a).z*(a).z));(a).x*=dtmp;(a).y*=dtmp;(a).z*=dtmp;}
  531. #define viVecHalf(a, b, c)        {(a).x=0.5*((b).x+(c).x);(a).y=0.5*((b).y+(c).y);(a).z=0.5*((b).z+(c).z);}
  532.  
  533. #if defined(__cplusplus)
  534. extern "C" {
  535. #endif
  536.  
  537. /*
  538.  * Protos
  539.  */
  540. extern viVECTOR            *viMakeVector(viVECTOR *, viDBL, viDBL, viDBL);
  541. extern viVECTOR4p        *viMakeVector4p(viVECTOR4p *, viDBL, viDBL, viDBL, viDBL);
  542. extern viCOLOR            *viMakeColor(viCOLOR *, viFLT, viFLT, viFLT);
  543. extern viMATRIX            *viMatrixIdentity(viMATRIX *);
  544. extern viSHEAR            *viMakeShear(viSHEAR *, viDBL, viDBL, viDBL, viDBL, viDBL, viDBL);
  545.  
  546. // ---- VIB ----
  547. extern viFILE            *viNewBinaryVIB(char *);
  548. extern int                viCloseBinaryVIB(viFILE *);
  549. /* Camera */
  550. extern viCAMERA            *viNewCamera(void);
  551. extern void                viDumpCamera(viCAMERA *, viFILE *);
  552.  
  553. /* Options */
  554. extern viOPTIONS        *viNewOptions(void);
  555. extern void                viDumpOptions(viOPTIONS *, viFILE *);
  556.  
  557. /* General */
  558. extern viGENERAL        *viNewGeneral(void);
  559. extern void                viDumpGeneral(viGENERAL *, viFILE *);
  560.  
  561. /* Point light */
  562. extern viPOINT_LIGHT    *viNewPointLight(void);
  563. extern void                viDumpPointLight(viPOINT_LIGHT *, viFILE *);
  564.  
  565. /* Spot light */
  566. extern viSPOT_LIGHT        *viNewSpotLight(void);
  567. extern void                viDumpSpotLight(viSPOT_LIGHT *, viFILE *);
  568.  
  569. /* Directional light */
  570. extern viDIRECTIONAL_LIGHT    *viNewDirectionalLight(void);
  571. extern void                    viDumpDirectionalLight(viDIRECTIONAL_LIGHT *, viFILE *);
  572.  
  573. /* Black hole */
  574. extern viBLACK_HOLE        *viNewBlackHole(void);
  575. extern void                viDumpBlackHole(viBLACK_HOLE *, viFILE *);
  576.  
  577. /* Spherical area light */
  578. extern viSPH_AREA_LIGHT    *viNewSphAreaLight(void);
  579. extern void                viDumpSphAreaLight(viSPH_AREA_LIGHT *, viFILE *);
  580.  
  581. /* Polygonal area light */
  582. extern viFLAT_AREA_LIGHT    *viNewFlatAreaLight(void);
  583. extern void                    viDumpFlatAreaLight(viFLAT_AREA_LIGHT *, viFILE *);
  584.  
  585. /* Skylight & sunlight */
  586. extern viSKY_DOME        *viNewSkyDome(void);
  587. extern void                viDumpSkyDome(viSKY_DOME *, viFILE *);
  588.  
  589. /* Shape modifers */
  590. extern viSHAPE_MODIFIERS    *viNewShapeModifiers(void);
  591. extern void                    viDumpShapeModifiers(viSHAPE_MODIFIERS *, viFILE *);
  592.  
  593. /* Object ID */
  594. extern void                viDeclareNewObject(char *, viFILE *);
  595. extern void                viEndObjectDeclaration(viFILE *);
  596. extern void                viCallObject(char *, viFILE *);
  597. extern void                viEndObjectCall(viFILE *);
  598. extern void                viObjectShaderName(char *, viFILE *);
  599.  
  600. /* Primitive ID */
  601. extern void                viPrimitive(viFILE *);
  602. extern void                viEndPrimitive(viFILE *);
  603. extern void                viPrimitiveShaderName(char *, viFILE *);
  604.  
  605. /* Object & Primitive transformation modifiers */
  606. extern void                viDumpScale(viVECTOR *, viFILE *);
  607. extern void                viDumpTranslate(viVECTOR *, viFILE *);
  608. extern void                viDumpRotate(viVECTOR *, viFILE *);
  609. extern void                viDumpTransform(viTRANSFORM *, viFILE *);
  610. extern void                viDumpMatrix(viMATRIX *, viFILE *);
  611. extern void                viDumpShear(viSHEAR *, viFILE *);
  612.  
  613. /* Basic shapes for Object & Primitive */
  614. extern void                viDumpPatch(viPATCH *, viFILE *);
  615. extern void                viDumpPatchUV(viPATCH_UV *, viFILE *);
  616. extern void                viDumpSphere(viSPHERE *, viFILE *);
  617. extern void                viDumpCone(viCONE *, viFILE *);
  618. extern void                viDumpCylinder(viCYLINDER *, viFILE *);
  619. extern void                viDumpDisk(viDISK *, viFILE *);
  620. extern void                viDumpRing(viRING *, viFILE *);
  621. extern void                viDumpTorus(viTORUS *, viFILE *);
  622. extern void                viDumpBox(viBOX *, viFILE *);
  623. extern void                viDumpSuperQuadric(viSUPERQ *, viFILE *);
  624. extern void                viDumpPolygon(viPOLYGON *, viFILE *);
  625. extern void                viDumpBicubicPatch(viBEZIER *, viFILE *);
  626. extern void                viDumpParaboloid(viPARABOLOID *, viFILE *);
  627. /* nurbs... */
  628. extern viNURBS            *viNewNURBS(int, int, int, int);
  629. extern void                viDumpNURBS(viNURBS *, viFILE *);
  630. extern int                viDeleteNURBS(viNURBS *);
  631. /* blobby... */
  632. extern viBLOBBY            *viNewBlobby(viDBL, int);
  633. extern void                viDumpBlobby(viBLOBBY *, viFILE *);
  634. extern int                viDeleteBlobby(viBLOBBY *);
  635. // ---- VIB ----
  636.  
  637. // ---- MSH ----
  638. extern int                viNewMSHFile(char *);
  639. extern int                viCloseMSHFile(void);
  640.  
  641. /* Mesh modifiers */
  642. extern viSHAPE_MODIFIERS    *viNewMeshModifiers(void);
  643. extern void                    viAddMeshModifiers(viSHAPE_MODIFIERS *);
  644.  
  645. /* Mesh ID */
  646. extern void                viStartMeshDeclaration(char *);
  647. extern void                viEndMeshDeclaration(void);
  648. extern void                viCallMesh(char *);
  649. extern void                viEndMesh(void);
  650. extern void                viSetMeshShader(char *);
  651.  
  652. /* Mesh transformation modifiers */
  653. extern void                viScaleMesh(viVECTOR *);
  654. extern void                viTranslateMesh(viVECTOR *);
  655. extern void                viRotateMesh(viVECTOR *);
  656. extern void                viTransformMesh(viTRANSFORM *);
  657. extern void                viMatrixMesh(viMATRIX *);
  658. extern void                viShearMesh(viSHEAR *);
  659.  
  660. /* Mesh basic primitives */
  661. extern void                viAddPatchToMesh(viPATCH *);
  662. extern void                viAddPatchUVToMesh(viPATCH_UV *);
  663. extern void                viAddPolygonToMesh(viPOLYGON *);
  664. extern void                viAddSphereToMesh(viSPHERE *);
  665. extern void                viAddConeToMesh(viCONE *);
  666. extern void                viAddCylinderToMesh(viCYLINDER *);
  667. extern void                viAddBoxToMesh(viBOX *);
  668. // ---- MSH ----
  669.  
  670. #if defined(__cplusplus)
  671. }
  672. #endif
  673.  
  674. #endif // _VIB_SDK